Skip to content

2.1 - #2

Closed
covao wants to merge 4 commits into
mainfrom
2.1
Closed

2.1#2
covao wants to merge 4 commits into
mainfrom
2.1

Conversation

@covao

@covao covao commented Jul 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 26, 2026 08:08
@covao covao closed this Jul 26, 2026
@covao
covao deleted the 2.1 branch July 26, 2026 08:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR appears to be a “2.1” release update that shifts ParamUI toward a single-file consumption model and adds UI enhancements for string parameters (regex validation) plus a small UX tweak for flat parameter tables.

Changes:

  • Added regex pattern validation for textbox parameters (live feedback + reject invalid commits).
  • Auto-minimized the navigation tree when the parameter hierarchy is flat (root-only).
  • Updated README install/docs accordingly and removed legacy packaging entrypoints.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
setup.py Removed setuptools-based packaging script (implies moving away from pip install distribution).
README.md Documented regex validation + navigation behavior and updated installation instructions.
paramui/__init__.py Removed package-level re-export (consistent with single-module usage).
paramui.py Implemented regex textbox validation and navigation tree auto-minimize behavior.
Comments suppressed due to low confidence (5)

paramui.py:771

  • step is treated as a regex pattern for any non-empty string (except *.…/folder). This will misclassify sentinel strings like file/button as regex patterns (and even reject initial values that don't match). Consider excluding non-regex sentinel values from pattern registration.

This issue also appears in the following locations of the same file:

  • line 809
  • line 844
    paramui.py:846
  • Headless initialization registers regex patterns for any non-empty string step (even when initial_value is not a string), and doesn't exclude sentinel values like file. This can cause unexpected validation behavior later. Align the condition with the UI path (string-valued + pattern-looking steps only).
    paramui.py:919
  • The docstring says valid text becomes "green/default", but the implementation doesn’t set green and (after this PR) hardcodes black for valid text. Update the docstring to match the actual behavior (or change the behavior to truly restore the default color).

This issue also appears on line 983 of the same file.
paramui.py:986

  • _apply_pattern_color hardcodes fg='black' for valid input, which doesn’t reliably restore the widget’s original/default foreground (and can be unreadable in dark themes). Prefer resetting to the default foreground instead of forcing black.
    paramui.py:813
  • The new regex-textbox branch triggers for any non-empty string step. That means sentinel strings like file (or any other future string-based widget type) will be treated as regex validation. Make the regex branch conditional on successful pattern registration instead (e.g., variable in self.patterns).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
['Flag', 'Flag 1', True, []], # Checkbox
['Text', 'Text Input', 'ABC', []], # Textbox
['Name', 'Name', 'Taro', '[A-Za-z ]{0,32}'], # Textbox with regex pattern validation
['Options/File', 'File Path', '*.txt', 'file'], # File browser
Comment thread README.md
Comment on lines +21 to 26
### Method 1: Download to the current folder using wget:
```bash
pip install git+https://github.com/covao/ParamUI
wget https://raw.githubusercontent.com/covao/ParamUI/main/paramui/paramui.py
```
### Method 2: Download the source code
Download [paramui.py](./paramui/paramui.py) and place it in your project directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants